# @Author: TonghuiWu
# @Date:   2018-11-23 23:41:00
# @Last Modified by:   TonghuiWu
# @Last Modified time: 2018-11-23 23:55:10
# @E-mail: wutonghui22@163.com

import xadmin

from .models import CityDict, CurseOrg, Teacher


class CityDictAdmin(object):
    """
    '城市'表在后台管理中的管理设置
    """
    list_display = ['name', 'desc', 'add_time']
    search_field = ['name', 'desc']
    list_filter = ['name', 'desc', 'add_time']

class CurseOrgAdmin(object):
    """
    '课程机构'表在后台管理中的管理设置
    """
    list_display = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city', 'add_time']
    search_field = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city']
    list_filter = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city', 'add_time']

class TeacherAdmin(object):
    """
    '教师'表在后台管理中的管理设置
    """
    list_display = ['org', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_nums', 'fav_nums', 'add_time']
    search_field = ['org', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_nums', 'fav_nums']
    list_filter = ['org', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_nums', 'fav_nums', 'add_time']


xadmin.site.register(CityDict, CityDictAdmin)
xadmin.site.register(CurseOrg, CurseOrgAdmin)
xadmin.site.register(Teacher, TeacherAdmin)